<div class="position">当前位置：<a href="<?php echo Yii::app()->createUrl('member/index/index');?>"><?php echo t('Member','web') ?></a> &gt; <a href="<?php echo Yii::app()->createUrl('member/info/info');?>">帐户管理</a> &gt; 个人资料</div>
        <div class="hr_12"></div>
        <!--个人资料 start-->
         <div class="userinfo_box pub_tab" id="userInfo">
         	<div class="tab_hd2">
                <ul class="c_f">
                    <li><a href="<?php echo Yii::app()->createUrl('member/info/info');?>">基本资料<b class="mem_bgx left"></b><b class="mem_bgx right"></b></a></li>
                    <li class="select"><a href="<?php echo Yii::app()->createUrl('member/info/face');?>">更改头像<b class="mem_bgx left"></b><b class="mem_bgx right"></b></a></li>
                    <li><a href="<?php echo Yii::app()->createUrl('member/info/level');?>">会员等级<b class="mem_bgx left"></b><b class="mem_bgx right"></b></a></li>
                </ul>
            </div>
            <div class="tab_cont2">
                <?php $form=$this->beginWidget('CActiveForm', array(  
					'id'=>'user-form',
					'enableClientValidation'=>true, 
					'enableAjaxValidation'=>true,  
					'htmlOptions'=>array('enctype'=>'multipart/form-data'),  
				)); ?>  
                	<div class="alter_face c_f">
                    	<div class="face_big f_l"><img id="preview" src="/<?php echo !empty(Yii::app()->user->face)?Yii::app()->user->face:'images/no_face.png'; ?>" alt="" /></div>
                        <div class="upload f_l">
                        	<p>仅支持jpg,gif,png图片文件，且文件小于1M,图片长宽比为：1：1</p>
                        	<p><?php echo CHtml::activeFileField($model,'zm_face'); ?></p>
                        	<p><?php echo $form->error($model,'zm_face'); ?></p>
                            <p style=" margin-top:10px;"><input class="mem_btn mem_btn05" type="submit" name="" value="保存头像" /></p>
                        </div>
                    </div>
                <?php $this->endWidget(); ?>
         	</div>            
         </div>
    	<!--个人资料 end-->
<script>
$('#Member_zm_face').change(
	function(){
		//setImagePreview();
	}
);
function setImagePreview() {
        var docObj=document.getElementById("Member_zm_face");
 
        var imgObjPreview=document.getElementById("preview");
                if(docObj.files &&    docObj.files[0]){
                        //火狐下，直接设img属性
                        imgObjPreview.style.display = 'block';
                        imgObjPreview.style.width = '320px';
                        imgObjPreview.style.height = '320px';                    
                        //imgObjPreview.src = docObj.files[0].getAsDataURL();

      //火狐7以上版本不能用上面的getAsDataURL()方式获取，需要一下方式  
      imgObjPreview.src = window.URL.createObjectURL(docObj.files[0]);

                }else{
                        //IE下，使用滤镜
                        docObj.select();
                        var imgSrc = document.selection.createRange().text;
                        var localImagId = document.getElementById("localImag");
                        //必须设置初始大小
                        localImagId.style.width = "320px";
                        localImagId.style.height = "320px";
                        //图片异常的捕捉，防止用户修改后缀来伪造图片
try{
                                localImagId.style.filter="progid:DXImageTransform.Microsoft.AlphaImageLoader(sizingMethod=scale)";
                                localImagId.filters.item("DXImageTransform.Microsoft.AlphaImageLoader").src = imgSrc;
                        }catch(e){
                                alert("您上传的图片格式不正确，请重新选择!");
                                return false;
                        }
                        imgObjPreview.style.display = 'none';
                        document.selection.empty();
                }
                return true;
        }
</script>		